package clientGUI.userPanels.Controllers;

import college.Date;
import college.RequestTreatment;
import clientGUI.Controllers.Controller;
import clientserver.Client;

public class EvaluatorSetDeadLineController extends Controller {

	private int rid;
	private RequestTreatment rt;
	private Date currdate;
	private Date  enddate;
	public String[] possibledaysindeadline={"1","2","3","4","5","6","7","8","9","10","11","12","13","14"};
	
	public EvaluatorSetDeadLineController( Client c,int id)
	{
		client=c;
		rid=id;
		String t= client.getDate();
		rt= new  RequestTreatment(c, id);
		rt.loadfromdb();  // to save evaluator  for next stage
		currdate =new Date(t);
		enddate=currdate;
	}
	
	
	public String getStartDate()
	{
		return currdate.toString();
	}
	

	
	public void addDays(int d)
	{
		enddate.addDays(d);
	}
	
	public String  getEndDate()
	{
		return  enddate.toString();
	}
	
	
	public void updateDBdays()
	{
		rt.setStartDate(currdate.toString());
		rt.setEndDate(enddate.toString());
		rt.setcurrentstage(3); //  go to EVALUATOR_READY stage - now wait's for deadline approve from supervisor
		
		rt.updatetoDB();
	}
}